const utilTool = {
  isEmpty: function (str) {
    if (str == null || str == undefined || str == '') {
      return true;
    }
    return false;
  },
  isNotEmpty: function (str) {
    return !this.isEmpty(str);
  },
  getDate: function () {
    return new Date().toISOString().slice(0, 10);
  },
  theme: 1,
  changeTheme: function () {
    if (this.theme == 2) {
      this.theme = 1;
    } else {
      this.theme++;
    }
    switch (this.theme) {
      case 1:
        document.documentElement.style.setProperty('--color-text-pink', '#fc3a72');
        document.documentElement.style.setProperty('--color-text-pink-light', '#f2dbed');
        document.documentElement.style.setProperty('--color-text-black', 'rgba(31, 26, 27)');
        document.documentElement.style.setProperty('--color-text-black-light', 'rgba(31, 26, 27, 0.5)');
        document.documentElement.style.setProperty('--color-text-white', '#fcf8f9');
        document.documentElement.style.setProperty('--color-shade', 'rgba(0, 0, 0, 0.2)');
        break;
      case 2:
        document.documentElement.style.setProperty('--color-text-pink', '#843afc');
        document.documentElement.style.setProperty('--color-text-pink-light', '#f2dbf2');
        document.documentElement.style.setProperty('--color-text-black', 'rgb(243, 233, 235)');
        document.documentElement.style.setProperty('--color-text-black-light', 'rgba(243, 233, 235, 0.5)');
        document.documentElement.style.setProperty('--color-text-white', '#0a0a0a');
        document.documentElement.style.setProperty('--color-shade', 'rgba(255, 255, 255, 0.2)');
        break;
      case 3:
        document.documentElement.style.setProperty('--color-text-pink', '#843afc');
        document.documentElement.style.setProperty('--color-text-pink-light', '#f2dbf2');
        document.documentElement.style.setProperty('--color-text-black', 'rgba(31, 26, 27)');
        document.documentElement.style.setProperty('--color-text-black-light', 'rgba(31, 26, 27, 0.5)');
        document.documentElement.style.setProperty('--color-text-white', '#fcf8f9');
        document.documentElement.style.setProperty('--color-shade', 'rgba(0, 0, 0, 0.2)');
        break;
      case 4:
        break;
      case 5:
        break;
      case 6:
        break;
      default:
        document.documentElement.style.setProperty('--color-text-pink', '#fc3a72');
        document.documentElement.style.setProperty('--color-text-pink-light', '#f2dbed');
        document.documentElement.style.setProperty('--color-text-black', 'rgba(31, 26, 27)');
        document.documentElement.style.setProperty('--color-text-black-light', 'rgba(31, 26, 27, 0.5)');
        document.documentElement.style.setProperty('--color-text-white', '#fcf8f9');
        break;
    }
  },
};

export default utilTool;
